home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 22 / Cream of the Crop 22.iso / program / bltw127.zip / BULLET.H < prev    next >
C/C++ Source or Header  |  1996-11-15  |  9KB  |  329 lines

  1. /*      bullet.h
  2.  
  3.         Defines the BULLET library's structs, consts, and function declaration
  4.  
  5.         v1.11 18-Nov-94
  6.         v.127 15-Nov-96 -chh changed fieldtype[1] to fieldtype in struct fielddesctype
  7.  
  8.     ***********************************************************************
  9.     * NOTE: BULLET is for medium, large, or huge models (do not use tiny, *
  10.     * ---- small, or compact since these allow for only 1 code segment).  *
  11.     * For Win3.1, LARGE model is recommended (Petzold is out-of-date)     *
  12.     ***********************************************************************
  13.  
  14.      o IT IS HIGHLY RECOMMENDED THAT UNINITIALIZED BULLET DATA BYTES BE SET TO 0
  15.      including and especially fielddesctype,
  16.  
  17.      o Struct types must be standard byte packed; do not special align elements
  18.      either here or in your source code.  This means that you must ensure
  19.      that any and all Bullet structure definitions are surrounded by the
  20.      appropriate compiler mechanism to do no special alignment (i.e., byte
  21.      alignment means no special alignment).  This includes, for example,
  22.      your data record (yourrecord.TAG is a byte field and this would be padded
  23.      by your compiler, throwing off all field offsets, as just one example).
  24.  
  25.      YOUR PROGRAM WILL NOT RUN CORRECTLY UNLESS THIS IS SO!
  26. */
  27.  
  28. #ifndef __BULLET_H
  29.  
  30. #pragma pack(1)
  31.  
  32. #ifdef __cplusplus
  33. extern "C" {
  34. #endif
  35. int     far pascal BULLET(void far *datapack);
  36. #ifdef __cplusplus
  37. }
  38. #endif
  39.  
  40. #define INITXB          0            /* system */
  41. #define EXITXB          1
  42. #define ATEXITXB        2
  43. #define MEMORYXB        3
  44. #define BREAKXB         4
  45. #define BACKUPFILEXB    5
  46. #define STATHANDLEXB    6
  47. #define GETEXTERRORXB   7
  48. #define DVMONCXB        9
  49.  
  50. #define CREATEDXB       10           /* data control mid-level */
  51. #define OPENDXB         11
  52. #define CLOSEDXB        12
  53. #define STATDXB         13
  54. #define READDHXB        14
  55. #define FLUSHDHXB       15
  56. #define COPYDHXB        16
  57. #define ZAPDHXB         17
  58.  
  59. #define CREATEKXB       20           /* key control mid-level */
  60. #define OPENKXB         21
  61. #define CLOSEKXB        22
  62. #define STATKXB         23
  63. #define READKHXB        24
  64. #define FLUSHKHXB       25
  65. #define COPYKHXB        26
  66. #define ZAPKHXB         27
  67.  
  68. #define GETDESCRIPTORXB 30           /* data access mid-level */
  69. #define GETRECORDXB     31
  70. #define ADDRECORDXB     32
  71. #define UPDATERECORDXB  33
  72. #define DELETERECORDXB  34
  73. #define UNDELETERECORDXB 35
  74. #define PACKRECORDSXB   36
  75.  
  76. #define FIRSTKEYXB      40           /* key access mid-level */
  77. #define EQUALKEYXB      41
  78. #define NEXTKEYXB       42
  79. #define PREVKEYXB       43
  80. #define LASTKEYXB       44
  81. #define STOREKEYXB      45
  82. #define DELETEKEYXB     46
  83. #define BUILDKEYXB      47
  84. #define CURRENTKEYXB    48
  85.  
  86. #define GETFIRSTXB      60           /* key & data access high-level */
  87. #define GETEQUALXB      61
  88. #define GETNEXTXB       62
  89. #define GETPREVXB       63
  90. #define GETLASTXB       64
  91. #define INSERTXB        65
  92. #define UPDATEXB        66
  93. #define REINDEXXB       67
  94.  
  95. #define LOCKXB          80           /* network control */
  96. #define UNLOCKXB        81
  97. #define LOCKKEYXB       82
  98. #define UNLOCKKEYXB     83
  99. #define LOCKDATAXB      84
  100. #define UNLOCKDATAXB    85
  101. #define DRIVEREMOTEXB   86
  102. #define FILEREMOTEXB    87
  103. #define SETRETRIESXB    88
  104.  
  105. #define DELETEFILEDOS   100          /* DOS file I/O low-level */
  106. #define RENAMEFILEDOS   101
  107. #define CREATEFILEDOS   102
  108. #define OPENFILEDOS     103
  109. #define SEEKFILEDOS     104
  110. #define READFILEDOS     105
  111. #define WRITEFILEDOS    106
  112. #define CLOSEFILEDOS    107
  113. #define ACCESSFILEDOS   108
  114. #define EXPANDFILEDOS   109
  115. #define MAKEDIRDOS      110
  116.  
  117. #define cUNIQUE         1            /* key type flags */
  118. #define cCHAR           2
  119. #define cINTEGER        16
  120. #define cLONG           32
  121. #define cNLS            0x4000       /* note: cNLS is set by BULLET */
  122. #define cSIGNED         0x8000
  123.  
  124. #define READONLY        0            /* do NOT use O_RDONLY,O_WRONLY,O_RDWR */
  125. #define WRITEONLY       1
  126. #define READWRITE       2
  127.  
  128. #define COMPAT          0X0000       /* okay to use SH_DENYRW, etc. */
  129. #define DENYREADWRITE   0x0010       /* or O_DENYREADWRITE, etc.    */
  130. #define DENYWRITE       0x0020
  131. #define DENYREAD        0x0030
  132. #define DENYNONE        0x0040
  133. #define NOINHERIT       0x0080
  134.  
  135.  
  136. struct accesspack {
  137.         unsigned        func;
  138.         unsigned        stat;
  139.         unsigned        handle;
  140.         long            recno;       /* signed */
  141.         void       far *recptr;
  142.         void       far *keyptr;
  143.         void       far *nextptr;
  144. }; /* 22 */
  145.  
  146. struct breakpack {
  147.         unsigned        func;
  148.         unsigned        stat;
  149.         unsigned        mode;
  150. }; /* 6 */
  151.  
  152. struct copypack {
  153.         unsigned        func;
  154.         unsigned        stat;
  155.         unsigned        handle;
  156.         char       far *filenameptr;
  157. }; /* 10 */
  158.  
  159. struct createdatapack {
  160.         unsigned        func;
  161.         unsigned        stat;
  162.         char       far *filenameptr;
  163.         unsigned        nofields;
  164.         void       far *fieldlistptr;
  165.         unsigned        fileid;
  166. }; /* 16 */
  167.  
  168. struct createkeypack {
  169.         unsigned        func;
  170.         unsigned        stat;
  171.         char       far *filenameptr;
  172.         char       far *keyexpptr;
  173.         unsigned        xblink;
  174.         unsigned        keyflags;
  175.         int             codepageid;
  176.         int             countrycode;
  177.         char       far *collateptr;
  178. }; /* 24 */
  179.  
  180. struct fielddesctype {
  181.         char            fieldname[11];
  182.         char            fieldtype;
  183.         unsigned long   fieldda;
  184.         unsigned char   fieldlen;
  185.         unsigned char   fielddc;
  186.         long            fieldrez;
  187.         char            filler[10];
  188. }; /* 32 */
  189.  
  190. struct descriptorpack {
  191.         unsigned        func;
  192.         unsigned        stat;
  193.         unsigned        handle;
  194.         unsigned        fieldnumber;
  195.         struct fielddesctype   fd;
  196. }; /* 40 */
  197.  
  198. struct dosfilepack {
  199.         unsigned        func;
  200.         unsigned        stat;
  201.         char       far *filenameptr;
  202.         unsigned        handle;
  203.         unsigned        asmode;
  204.         unsigned        bytes;
  205.         long            seekoffset;
  206.         unsigned        method;
  207.         void       far *bufferptr;
  208.         unsigned        attr;
  209.         char       far *newnameptr;
  210. }; /* 30 */
  211.  
  212. struct dvmonpack {
  213.         unsigned        func;
  214.         unsigned        stat;
  215.         unsigned        mode;
  216.         unsigned        handle;
  217.         unsigned        vs;
  218. }; /* 10 */
  219.  
  220. struct exitpack {
  221.         unsigned        func;
  222.         unsigned        stat;
  223. }; /* 4 */
  224.  
  225. struct handlepack {
  226.         unsigned        func;
  227.         unsigned        stat;
  228.         unsigned        handle;
  229. }; /* 6 */
  230.  
  231. struct initpack {
  232.         unsigned        func;
  233.         unsigned        stat;
  234.         unsigned        jftmode;
  235.         unsigned        dosver;
  236.         unsigned        version;
  237.         unsigned        osversion;
  238.         unsigned long   exitptr;
  239. }; /* 16 */
  240.  
  241. struct memorypack {
  242.         unsigned        func;
  243.         unsigned        stat;
  244.         unsigned long   memory;
  245. };
  246.  
  247. struct openpack {
  248.         unsigned        func;
  249.         unsigned        stat;
  250.         unsigned        handle;
  251.         char       far *filenameptr;
  252.         unsigned        asmode;
  253.         unsigned        xblink;
  254. }; /* 14 */
  255.  
  256. struct remotepack {
  257.         unsigned        func;
  258.         unsigned        stat;
  259.         unsigned        handle;
  260.         unsigned        isremote;
  261.         unsigned        flags;
  262.         unsigned        isshare;
  263. }; /* 12 */
  264.  
  265. struct setretriespack {
  266.         unsigned        func;
  267.         unsigned        stat;
  268.         unsigned        mode;
  269.         unsigned        pause;
  270.         unsigned        retries;
  271. }; /* 10 */
  272.  
  273. struct statdatapack {
  274.         unsigned        func;
  275.         unsigned        stat;
  276.         unsigned        handle;
  277.         unsigned char   filetype;
  278.         unsigned char   dirty;
  279.         unsigned long   recs;
  280.         unsigned        reclen;
  281.         unsigned        fields;
  282.         char            f1;
  283.         unsigned char   luyear;
  284.         unsigned char   lumonth;
  285.         unsigned char   luday;
  286.         unsigned        hereseg;
  287.         char            filler[10];
  288. }; /* 32 */
  289.  
  290. struct statkeypack {
  291.         unsigned        func;
  292.         unsigned        stat;
  293.         unsigned        handle;
  294.         unsigned char   filetype;
  295.         unsigned char   dirty;
  296.         unsigned long   keys;
  297.         unsigned        keylen;
  298.         unsigned        xblink;
  299.         unsigned long   xbrecno;
  300.         unsigned        hereseg;
  301.         unsigned        codepageid;
  302.         unsigned        countrycode;
  303.         unsigned        collatetablesize;
  304.         unsigned        keyflags;
  305.         char            filler[2];
  306. }; /* 32 */
  307.  
  308. struct stathandlepack {
  309.         unsigned        func;
  310.         unsigned        stat;
  311.         unsigned        handle;
  312.         unsigned        id;
  313.         char       far *filenameptr;
  314. }; /* 12 */
  315.  
  316. struct xerrorpack {
  317.         unsigned        func;
  318.         unsigned        stat;
  319.         unsigned        errclass;
  320.         unsigned        action;
  321.         unsigned        location;
  322. }; /* 10 */
  323.  
  324. #pragma pack()
  325. #define __BULLET_H
  326. #endif
  327.  
  328. /* end of BULLET.H */
  329.